﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Kunde/WebsiteCustomer.Master" AutoEventWireup="true" CodeBehind="Kundedata.aspx.cs" Inherits="TireService.Website.Kunde.Kundedata" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">

<!-- Modal popup when waiting on server postback -->
<script src="../Scripts/ModalPopup.js" type="text/javascript"></script>    

<h3>Kundedata</h3>
    
    <asp:UpdatePanel ID="upEditCustomer" runat="server">
        <ContentTemplate>
            <table border="0" cellspacing="0" cellpadding="5" width="400px">
                <tr>
                    <td colspan="2">
                        <div style="font-family: Tahoma; font-size: 9pt; font-weight: normal; color: #f15e34">
                            &nbsp;<asp:Literal ID="lMessage" runat="server"></asp:Literal>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerName" runat="server" Text="Navn:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtName" runat="server" Width="175px" ClientIDMode="AutoID" >
                            <ValidationSettings  RequiredField-IsRequired="true" RequiredField-ErrorText="Navn skal udfyldes" ErrorDisplayMode="ImageWithTooltip">
                                <RequiredField IsRequired="True" ErrorText="Navn skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerAddress" runat="server" Text="Adresse:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtAddress" runat="server" Width="175px" ClientIDMode="AutoID" >
                            <ValidationSettings  RequiredField-ErrorText="Adresse skal udfyldes" ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true">
                                <RequiredField IsRequired="True" ErrorText="Adresse skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerZipCode" runat="server" Text="Postnr:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtZipCode" runat="server" Width="50px" ClientIDMode="AutoID" >
                            <ValidationSettings  RequiredField-IsRequired="true" 
                                RequiredField-ErrorText="Postnr skal udfyldes" 
                                ErrorDisplayMode="ImageWithTooltip" >
                                <RequiredField IsRequired="True" ErrorText="Postnr skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerCity" runat="server" Text="By:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtCity" runat="server" Width="175px" ClientIDMode="AutoID" >
                            <ValidationSettings  RequiredField-ErrorText="By skal udfyldes" ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="true">
                                <RequiredField IsRequired="True" ErrorText="By skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerCountry" runat="server" Text="Land:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxComboBox ID="ddlCountry" IncrementalFilteringMode="StartsWith" 
                            runat="server" ClientIDMode="AutoID" EnableIncrementalFiltering="True" Spacing="0" ValueType="System.String">
                            <ValidationSettings  RequiredField-IsRequired="true" RequiredField-ErrorText="Land skal vælges" ErrorDisplayMode="ImageWithTooltip">
                                <RequiredField IsRequired="True" ErrorText="Land skal v&#230;lges"></RequiredField>
                            </ValidationSettings>
                            <LoadingPanelStyle ImageSpacing="5px">
                            </LoadingPanelStyle>
                        </dx:ASPxComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerSecondaryAddress" runat="server" Text="Sekundær adresse:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtSecondaryAddress" runat="server" Width="175px" ClientIDMode="AutoID" >
                            <ValidationSettings  ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Sekundær adresse skal udfyldes" RequiredField-IsRequired="true">
                                <RequiredField IsRequired="True" ErrorText="Sekund&#230;r adresse skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerSecondaryZipCode" runat="server" Text="Sekundær postnr:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtSecondaryZipCode" runat="server" Width="50px" ClientIDMode="AutoID" >
                            <ValidationSettings  ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Sekundær postnr skal udfyldes" RequiredField-IsRequired="true">
                                <RequiredField IsRequired="True" ErrorText="Sekund&#230;r postnr skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerSecondaryCity" runat="server" Text="Sekundær by:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtSecondaryCity" runat="server" Width="175px" ClientIDMode="AutoID" >
                            <ValidationSettings  ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="Sekundær by skal udfyldes" RequiredField-IsRequired="true">
                                <RequiredField IsRequired="True" ErrorText="Sekund&#230;r by skal udfyldes"></RequiredField>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerPhone1" runat="server" Text="Telefon 1:"></asp:Label>
                    </td>
                    <td>
                            <table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <dx:ASPxTextBox ID="txtPhone1" runat="server" Width="75px" ClientIDMode="AutoID">
                                        <MaskSettings Mask="00000000" ErrorText="Telefon nr. ikke gyldigt" />
                                        <ValidationSettings RequiredField-IsRequired="true" 
                                            ErrorDisplayMode="ImageWithTooltip" >
                                            <RequiredField IsRequired="True"></RequiredField>
                                        </ValidationSettings>
                                    </dx:ASPxTextBox>
                                </td>
                                <td>&nbsp;</td>
                                <td>
                                    <dx:ASPxComboBox ID="ddlPhone1Type" runat="server" Width="75px" ClientIDMode="AutoID" Spacing="0" 
                                        ValueType="System.String">
                                        <ValidationSettings RequiredField-IsRequired="true">
                                            <RequiredField IsRequired="True"></RequiredField>
                                        </ValidationSettings>
                                        <Items>
                                            <dx:ListEditItem Value="0" Text="Mobil" />
                                            <dx:ListEditItem Value="1" Text="Fastnet" />
                                        </Items>
                                        <LoadingPanelStyle ImageSpacing="5px">
                                        </LoadingPanelStyle>
                                    </dx:ASPxComboBox>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerPhone2" runat="server" Text="Telefon 2:"></asp:Label>
                    </td>
                    <td>
                        <table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <dx:ASPxTextBox ID="txtPhone2" runat="server" Width="75px" 
                                        ClientIDMode="AutoID" >
                                        <ValidationSettings  ErrorDisplayMode="ImageWithTooltip" RequiredField-IsRequired="false" />
                                    </dx:ASPxTextBox>
                                </td>
                                <td>&nbsp;</td>
                                <td>
                                    <dx:ASPxComboBox ID="ddlPhone2Type" runat="server" Width="75px" 
                                        ClientIDMode="AutoID" Spacing="0" ValueType="System.String">
                                        <ValidationSettings ></ValidationSettings>
                                        <Items>
                                            <dx:ListEditItem Value="0" Text="Mobil" />
                                            <dx:ListEditItem Value="1" Text="Fastnet" />
                                        </Items>
                                        <LoadingPanelStyle ImageSpacing="5px">
                                        </LoadingPanelStyle>
                                    </dx:ASPxComboBox>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblCustomerEmail" runat="server" Text="Email:"></asp:Label>
                    </td>
                    <td>
                        <dx:ASPxTextBox ID="txtEmail" runat="server" Width="182px" ClientIDMode="AutoID">
                            <ValidationSettings ErrorDisplayMode="ImageWithTooltip" >
                                <RequiredField IsRequired="True" ErrorText="Venligst udfyld email adresse"></RequiredField>
                                <RegularExpression ErrorText="Email ikke gyldig" ValidationExpression="\w+([-+.&#39;]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></RegularExpression>
                            </ValidationSettings>
                        </dx:ASPxTextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" colspan="2">
                        <dx:ASPxButton ID="btnSave" runat="server" Text="Opdater" 
                            onclick="btnSave_Click">
                        </dx:ASPxButton>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
